#ifndef WIDGET_SAMPLE_H
#define WIDGET_SAMPLE_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <assert.h>
#include <hi_gv.h>
#include <mpp_help.h>
#include <aic_mng.h>
#include "sample_comm.h"
#include "higv_cextfile.h"
#ifdef __cplusplus
extern "C" {
#endif
#define RES_PATH  "./res/"

#define SBFONT_FILE  RES_PATH"font/ttf/simhei.ttf"
#define MBFONT_FILE  RES_PATH"font/ttf/simhei.ttf"
#define DTS_2_VO_PTS  40000
#define MILLISECOND     1000

#define SCREEN_WIDTH  480
#define SCREEN_HEIGHT 800

#define HIGO_VPSS_WIDTH_MAX      2688 // 
#define HIGO_VPSS_HEIGHT_MAX     2160 //

#define HIGO_VPSS_GRP            3 // vpss grp

typedef struct HigoAic_ {
	VpssCfg vpssCfg;
    HI_S32 vpssGrp;
    HI_S32 vpssChn;
    int vpssFd;
    bool vpssWorking;
	int voLayer;
	pthread_t g_UiThreadId;
	pthread_t UiSwitchLoopId;
	HIGV_HANDLE g_layerId;
	HIGV_HANDLE g_hApp;
	HI_S32 g_touchfd;
	int g_Rotate;
	bool voReady;
	bool working;
	uint64_t pts;
    uint32_t timeRef;
	HIGV_HANDLE curUi;
	HIGV_HANDLE reqUi;
	bool recording;
	bool playing;
	bool capture_flag;
	pthread_mutex_t mutex;
}HigoAic;

#define INVALID_HANDLE 0x0
#define WIDGET_CHECK_RET(p, val)   if(!(p)) { printf("Error==%s,%d==\n", __FUNCTION__, __LINE__);return (val);}

#define HI_GV_Widget_SetMsgProcX(x1,x2,x3)  HI_GV_Widget_SetMsgProc(x1,x2,x3,HIGV_PROCORDER_BEFORE)

#define HIGV_CONTROL_PAGENUM   16

#define HIGV_CHECK(Function, ret)  \
    if (ret != HI_SUCCESS) {printf("[Func: %s, Line: %d] %s fail ret(x):%x, ret(d): %d\n", \
        __FUNCTION__, __LINE__, Function, ret, ret);}
HI_S32 GetLayer(HI_VOID);

#ifdef __cplusplus
}
#endif
#endif

